export default {
  data() {
    return { currentTime: '' };
  },
  props: {
    title: { type: String }
  },
  mounted() {
    let incrementNumber = () => {
      setTimeout(incrementNumber, 1000);
      const weekDayText = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][dayjs().format('d')];
      this.currentTime = `${dayjs().format('YYYY年MM月DD日')} ${weekDayText} ${dayjs().format('HH:mm')}`;
    }
    setTimeout(incrementNumber, 500);
  },
  template: `
  <div class="parallelogram header-outer">
    <el-row>
      <el-col :span="7" style="padding-left: 35px;">
        <img src="../images/aeec_logo.png" height="60" alt="黎阳LOGO" />
      </el-col>
      <el-col :span="10" class="header-title">
        <div class="parallelogram header-inner">
          {{title}}
        </div>
      </el-col>
      <el-col :span="7" class="currentTime" style="padding-right: 35px;font-size: 18px;">
        {{currentTime}}
      </el-col>
    </el-row>
  </div>
  `
}